
<core:wrap file="_cp/page.html" in="content_zone">
<core:wrap file='_cp/central_part.html'>

<core:wrap in='title_zone'>News list</core:wrap>

<core:wrap in='actions'>
    <route_url params="action:create" extra='?popup=1' onclick='return Limb.Http.click(this.href);'>Create news</route_url>
</core:wrap>

  <core:wrap in='table'>

    <active_record:fetch class_path='src/model/News' target="news" />
    <list:LIST id='news'>
      <form name='list_form' method='post'>
      <table cellpadding="0" cellspacing="0" class="list">
        <tr class="header">
          <th class="left"><img src='/images/icon/selectall.gif'/>&nbsp;<input type='checkbox' onclick='MarkAll(checked);' name='mark_all'/></th>
          <th>Title</th>
          <th>Author</th>
          <th>Date</th>
          <th>Published?</th>
          <th class="right">Actions</th>
        </tr>
      <tbody>
        <list:ITEM>
        <tr>
          <td class="left">
            <input type='checkbox' name='ids[]' value='{$id}' class='input' runat='client'/>
          </td>
          <td>{$title}</td>
          <td>{$author.login}</td>
          <td>{$news_date|i18n_date:"", "stamp", "", "%d.%m.%Y %H:%M"}</td>
          <td><core:OPTIONAL for='is_published'>Yes</core:OPTIONAL><core:DEFAULT for='is_published'>No</core:DEFAULT></td>
          <td align="center">
            <route_url params="action:unpublish" extra='?ids[]={$id}&popup=1' onclick='return Limb.Http.click(this.href)' title="Unpublish"><img alt="Unpublish" title="Unpublish" src="/images/icon/action/unpublish.gif"/></route_url>
            <route_url params="action:publish" extra='?ids[]={$id}&popup=1' onclick='return Limb.Http.click(this.href)' title="Publish"><img alt="Publish" title="Publish" src="/images/icon/action/publish.gif"/></route_url>
            <route_url params="action:edit,id:{$id}" extra='?popup=1' onclick='return Limb.Http.click(this.href)' title="Edit"><img alt="Edit" title="Edit" src="/images/icon/action/edit.gif"/></route_url>
            <route_url params="action:delete" extra='?ids[]={$id}&popup=1' onclick='return Limb.Http.click(this.href)' title="Delete"><img alt="Delete" title="Delete" src="/images/icon/action/delete.gif"/></route_url>
          </td>
        </tr>
        </list:ITEM>
      </tbody>
      </table>
      <br/>
      <route_url_set field='delete_url' params="action:delete" />
      <input type='submit' value='Delete' onclick='Limb.Form.submit(this.form, "{$delete_url}?popup=1");return false;'/>
      </form>
    </list:LIST>
  </core:wrap>


</core:wrap>
</core:wrap>
